﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace HU8.Web.FileExplorer
{
    public class FileExplorerPage : System.Web.UI.Page
    {
        protected FileExplorerConfig config;
        protected LanguageDictionary lang;

        //This happens prior to page load
        protected void Page_Init(object sender, EventArgs e)
        {
            config = new FileExplorerConfig(Server);

            if (Request["lang"] != null)
            {
                //allow to pass in configuration
                config.Language = Request["lang"];
                Session["lang"] = config.Language;
            }
            else if (Session["lang"] != null)
            {
                config.Language = Session["lang"].ToString();
            }

            lang = new LanguageDictionary(config.Language, Server); //load languages
        }
    }
}